<form action="" method="post">
    <select multiple="multiple" name="q[]">
        <option value="">选择一个站点:</option>
        <option value="RUNOOB">Runoob</option>
        <option value="GOOGLE">Google</option>
        <option value="TAOBAO">Taobao</option>
    </select>
    <input type="submit" value="提交">
</form>
<?php
//isset 检测一个变量是否为空，htmlspecialcahrs() 可以转换为HTML实体
$q = isset($_POST['q']) ? $_POST['q'] : '';
if (is_array($q))
{
    $site=array(
        'RUNOOB' => '菜鸟教程',
        'GOOGLE' => '菜鸟教程2',
        'TAOBAO' => '菜鸟教程3',
    );
    foreach ($q as $item) {
        echo $site[$item] ;
        echo "<br>";
    }
}
